//
// Description: 384. 打乱数组
// Created by Loading on 2021/11/22.
//

#include <bits/stdc++.h>

using namespace std;

class Solution {
public:
    explicit Solution(vector<int> &nums) {
        this->nums = nums;
    }

    vector<int> reset() {
        return nums;
    }

    vector<int> shuffle() {
        unsigned seed = chrono::system_clock::now().time_since_epoch().count();
        vector<int> tmp = nums;
        ::shuffle(tmp.begin(), tmp.end(), default_random_engine(seed));

        return tmp;
    }

private:
    vector<int> nums;
};

int main() {
    vector<int> nums = {1, 2, 3};
    Solution solution(nums);
    nums = solution.shuffle();
    for (auto &x : nums) {
        cout << x << ' ';
    }
    cout << endl;
    nums = solution.reset();
    for (auto &x : nums) {
        cout << x << ' ';
    }
    cout << endl;
    nums = solution.shuffle();
    for (auto &x : nums) {
        cout << x << ' ';
    }
    cout << endl;

    return 0;
}